{% extends 'index.html' %}

{% block sidebar %}
<div class="span2">
    <div class="well">
        {% if request.user.is_authenticated %}
        <h2>Perfil</h2>
        
        {% endif %}
        
        <h2>Plannings</h2>
        {% if Plannings %}
            <ul class="unstyled">
                {% for planning in Plannings %}
                <li><a href="{% url view_planning planning.id %}">{{ planning.title }}</a>
                {% if planning.active %}
                    <span class="label success">Active</span>
                {% else %}
                    <a href="{% url activate_planning planning.id %}" class="label warning">Activate</a>
                {% endif %}
                <a href="{% url delete_planning planning.id %}" class="close">×</a></li>
                {% endfor %}
            </ul>
        {% else %}
            <p>No se han creado plannings.</p>
        {% endif %}
        <a href="{% url new_planning %}" class="btn btn-primary">Nuevo</a>
    </div>
</div>
{% endblock %}

{% block app_planning %}{% endblock %}

{% block js_libs %}
    {{ block.super }}
    <!-- Third-Party Libraries (Order matters) -->
    <script src="{{STATIC_URL}}js/libs/jquery-1.7.1.min.js"></script>
    <script src="{{STATIC_URL}}js/libs/underscore-min.js"></script>
    <script src="{{STATIC_URL}}js/libs/backbone-min.js"></script>
    <script src="{{STATIC_URL}}js/libs/bootstrap-alerts.js"></script>
{% endblock %}
